<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('UCA-配置列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
           

        
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('conf:conf:edit')}]];
        var removeFlag = [[${@permission.hasPermi('conf:conf:remove')}]];
        var checkTypeDatas = [[${@dict.getType('check_type')}]];
        var prefix = ctx + "conf/conf/main";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "UCA-配置",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'sourceName',
                    title: '系统名称'
                },
                {
                    field: 'sourceFlag',
                    title: '系统标识'
                },
                {
                    field: 'source',
                    title: 'URL'
                },
                {
                    field: 'targetName',
                    title: '目标系统名称'
                },
                {
                    field: 'target',
                    title: '目标系统URL'
                },
                {
                    field: 'publicKey',
                    title: '公钥',
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    field: 'privateKey',
                    title: '私钥',
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    field: 'checkType',
                    title: '验证项',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabels(checkTypeDatas, value);
                    }
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                    	if(value=="0"){
                    		return	"正常";
                    	}else{
                    		return  "停用";	
                    	}
                    }
                },
                
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a>');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
       
    </script>
</body>
</html>